/*
 * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef DFX_CRASHER_H
#define DFX_CRASHER_H

#include <stdint.h>
#include "dfx_test_func.h"

int RaiseAbort(void);
int Abort(void);
int RaiseBusError(void);
int RaiseFloatingPointException(void);
int RaiseIllegalInstructionException(void);
int IllegalInstructionException(void);
int RaiseSegmentFaultException(void);
int SegmentFaultException(void);
int RaiseTrapException(void);
int CrashTest(void);


void PrintUsage(void);
void *DoCrashInThread(void *inputArg);
void *SleepThread(void *argv);

uint64_t DoActionOnSubThread(const char *arg);
uint64_t ParseAndDoCrash(const char *arg);
int MaxStackDepth(void);

//           1         2         3         4         5         6         7
//  1234567890123456789012345678901234567890123456789012345678901234567890
int MaxMethodNameTest12345678901234567890123456789012345678901234567890ABC(void);

int TriggerSegmentFaultException(void);
int TriggerTrapException(void);

#endif // DFX_CRASHER_H
